﻿//-----------------------------------------------------------------------
// <copyright file="RouteConfig.cs" company="CronopioDD">
//     Copyright CronopioDD. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace ProyectoGoya
{
    using System.Web.Http;
    using System.Web.Mvc;
    using System.Web.Routing;

    /// <summary>
    /// RouteConfig class
    /// </summary>
    public class RouteConfig
    {
        #region Constructor

        /// <summary>
        /// Prevents a default instance of the RouteConfig class from being created
        /// </summary>
        private RouteConfig()
        {
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// Method for registering routes
        /// </summary>
        /// <param name="routes">Provides a collection of routes for ASP.NET routing</param>
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapHttpRoute(name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional });

            routes.MapRoute(name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
        }

        #endregion
    }
}